<div class="section"> 
  <script type="text/javascript">
	$(document).ready(function(){
		$("#okie").click(function(){
			$title = $("#atitle"); $titval = $("#atitle").val();
			$quesid = $("#quesid"); $quesval = $("#quesid").val();
			$userid = $("#userid"); $userval = $("#userid").val();
			if($title.val() == ""){$title.focus(); return false;}
			if($quesid.val() == ""){$quesid.focus(); return false;}
			if($userid.val() == ""){$userid.focus(); return false;}
		})
		$("#cateid").change(function(){
			$id = $(this).val();
			jQuery.post("<?php echo base_url(); ?>admin/questions/getcago",{id:$id},function(result){
				$("#recagoid").html(result);
			});
		});
	});
	</script> 
  <!--[if !IE]>start title wrapper<![endif]-->
  <div class="title_wrapper"> <span class="title_wrapper_top"></span>
    <div class="title_wrapper_inner"> <span class="title_wrapper_middle"></span>
      <div class="title_wrapper_content">
        <h2 class="menu_title">Add new answer</h2>
      </div>
    </div>
    <span class="title_wrapper_bottom"></span> </div>
  <!--[if !IE]>end title wrapper<![endif]--> 
  
  <!--[if !IE]>start section content<![endif]-->
  <div class="section_content"> <span class="section_content_top"></span>
    <div class="section_content_inner">
      <div class="table_tabs_menu"> 
        <!--[if !IE]>start  tabs<![endif]--> 
        <!--[if !IE]>end  tabs<![endif]--> 
        
      </div>
      <!--[if !IE]>start table_wrapper<![endif]-->
      <div class="table_wrapper" style="background:none;">
        <div class="table_wrapper_inner">
          <div class="error_red">
            <?php if(isset($error)) { echo "<p>".$error."</p>"; } ?>
            <?php echo validation_errors();?> </div>
          <form action="<?php echo base_url();?>admin/answers/update/<?php echo $result['aid']; ?>" method="post" name="sac" onsubmit="return check()" enctype="multipart/form-data">
            <div class="form_items">
              <div class="form_items_left">Title</div>
              <div class="form_items_right">
                <input name="atitle" id="atitle" value="<?php echo $result['atitle']; ?>" type="text" size="35" />
              </div>
            </div>
            <div class="form_items">
              <div class="form_items_left">Id of question</div>
              <div class="form_items_right">
                <input name="quesid" id="quesid" value="<?php echo $result['quesid']; ?>" type="text" size="35" />
              </div>
            </div>
            <div class="form_items">
              <div class="form_items_left">Id of user</div>
              <div class="form_items_right">
                <input name="userid" id="userid" value="<?php echo $result['userid']; ?>" type="text" size="35" />
              </div>
            </div>
            <div class="form_items">
              <div class="form_items_left">Status</div>
              <div class="form_items_right">
                <input type="radio" value="1" name="astatus" <?php if($result['astatus'] == 1){ echo "checked='checked'";}?>/>Yes
                <input type="radio" value="0" name="astatus" <?php if($result['astatus'] == 0){ echo "checked='checked'";}?>/>No
              </div>
            </div>
            <div class="form_items">
              <div class="form_items_left">Likes</div>
              <div class="form_items_right">
                <input name="alike" value="<?php echo $result['alike']; ?>" type="text" size="35" />
              </div>
            </div>
            <div class="form_items">
              <div class="form_items_left">Dislike</div>
              <div class="form_items_right">
                <input name="adislike" value="<?php echo $result['adislike']; ?>" type="text" size="35" />
              </div>
            </div>
            <div class="form_items">
              <div class="form_items_left">Type your answer</div>
              <div class="form_items_right">
                <textarea name="ainfo" cols="35" rows="7"><?php echo $result['ainfo']; ?></textarea>
              </div>
            </div>
            <div class="form_items">
              <div class="form_items_left">&nbsp;</div>
              <div class="form_items_right">
                <input type="submit" name="okie" id="okie" value="Edit Now" class="magin"/>
                <input type="reset" name="Reset" id="button" value="Reset" class="magin"/>
              </div>
            </div>
          </form>
        </div>
      </div>
      <!--[if !IE]>end table_wrapper<![endif]--> 
    </div>
    <span class="section_content_bottom"></span> </div>
  <!--[if !IE]>end section content<![endif]--> 
</div>
